using System;
using System.Xml;
using Microsoft.Office.Server.Search.Administration;
using Microsoft.Office.Server.Search.Query;

namespace Hvam.SharePoint.Search.Query.Site
{
    public abstract class LocationRuntime : ILocationRuntime
    {
        public bool SupportsAsync
        {
            get { return false; }
        }

        public LocationConfiguration Config { get; set; }

        public Location Location { get; set; }

        public SortCollection SortList { get; set; }

        protected Exception Exception { get; set; }

        protected LocationRuntime()
        {
            SortList = new SortCollection();
        }

        public virtual void Dispose()
        {
            
        }

        public virtual XmlDocument SendRequest(string query)
        {
            throw new NotImplementedException();
        }

        public virtual IAsyncResult SendRequest(string query, ResultCallback callback)
        {
            throw new NotImplementedException();
        }

        public virtual Exception GetException()
        {
            return Exception;
        }

        public virtual string EncodeForLocationQueryFormat(string str)
        {
            return str;
        }

        public virtual string DecodeForLocationQueryFormat(string str)
        {
            return str;
        }

        public virtual void Close()
        {
            Dispose();
        }
    }
}